package services;

import com.google.wave.api.Wavelet;
import com.google.wave.api.oauth.LoginFormHandler;
import com.google.wave.api.oauth.OAuthService;
import com.google.wave.api.oauth.impl.OAuthServiceImpl;

// In this time is not functional, problem with libraries
public class OAuthRobotPAService {

private OAuthService oauthService;

public static final String CONSUMER_KEY = "1.latest.robotpa.appspot.com";
public static final String CONSUMER_SECRET = "9p/urEMLdVdXY+Ow7Pmb9Jgk";

public static final String REQUEST_TOKEN_URL = "http://www.google.com/m8/feeds/request_token";
public static final String ACCESS_TOKEN_URL = "http://www.google.com/m8/feeds/access_token";
public static final String AUTHORIZE_URL = "http://www.google.com/m8/feeds/authenticate";

	
public OAuthRobotPAService(String authUserId, String remoteHost) {
    String callbackUrl = "http://" + remoteHost + "/callback.html";
    oauthService = OAuthServiceImpl.newInstance(
        authUserId, CONSUMER_KEY, CONSUMER_SECRET, REQUEST_TOKEN_URL,
        AUTHORIZE_URL, callbackUrl, ACCESS_TOKEN_URL);
    
  }

public boolean checkAuthorization(Wavelet wavelet, LoginFormHandler loginForm) {
    return oauthService.checkAuthorization(wavelet, loginForm);
  }


}

